package com.tgy.clickhouse.controller;


import com.tgy.clickhouse.entity.Alarm;
import com.tgy.clickhouse.service.TestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Slf4j
@Api("测试")
@AllArgsConstructor
public class TestController {

    private final TestService service;

    @GetMapping("queryList")
    public List<String> queryList() {
        return service.query();
    }

    @PostMapping("insertAlarm")
    @ApiOperation("新增告警信息")
    public String insertAlarm(@RequestBody Alarm alarm) {
        return service.insertAlarm(alarm);
    }

    @PostMapping("getList")
    @ApiOperation("查询告警信息")
    public List<String> getList() {
        return service.queryList();
    }
}
